package gui.framework.intent;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import gui.utils.CastUtils;

public class Bundle {
	private Map<String, Serializable> extra;

	public Bundle() {
		extra = new HashMap<>();
	}

	public void putInt(String key, int value) {
		extra.put(key, value);
	}

	public int getInt(String key) {
		return CastUtils.castInt(extra.get(key));
	}

	public void putBoolean(String key, boolean value) {
		extra.put(key, value);
	}

	public boolean getBoolean(String key) {
		return CastUtils.castBoolean(extra.get(key));
	}

	public void put(String key, String value) {
		extra.put(key, value);
	}

	public String get(String key) {
		return CastUtils.castString(extra.get(key));
	}

	public void putSerializable(String key, Serializable value) {
		extra.put(key, value);
	}

	public Serializable getSerializable(String key) {
		return extra.get(key);
	}
}
